package com.boomsecret.undertow;

import io.undertow.Undertow;
import io.undertow.util.Headers;

/**
 * Created by wangjinliang on 2018/3/14.
 */
public class SimpleUndertowDemo {
    public static void main(String[] args) {
        Undertow.Builder builder = Undertow.builder();
        builder.addHttpListener(8080, "127.0.0.1");
        builder.setHandler(httpServerExchange -> {
            httpServerExchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain");
            httpServerExchange.getResponseSender().send("Hello Undertow");
        });
        builder.build().start();
    }
}
